[Slack Alert] Pinterest High Spend

This automation checks whether today’s spend of one of the campaigns exceeds a certain amount, which you define in the setup. If the campaign has spent more than the threshold, you will get a Slack notification with a link to the Ads Manager.

Get an alert on Slack every time your campaign/account reaches a minimum spend. You won't get a Slack message if none of your campaigns have higher spending.

Notion image

JSON Recipe

Import the automation recipe(s) into your own account. Don’t know how? Learn here.

High Spend: Slack Notifier [Campaign level]
{"name":"[Slack alert] Pinterest High Spend - Campaign Level","description":"A blank recipe","nodes":{"pinterest_fetch_campaigns_1":{"type":"pinterest_fetch_campaigns","logging_enabled":false,"x":438,"y":216,"group":"group_1","inputs":{"operational_status":{"export_enabled":true,"data":"RUNNING"}}},"data_relay_1":{"type":"data_relay","logging_enabled":false,"x":197,"y":220,"group":"group_1","inputs":{"data":{"title":"ad_account","description":"Data to relay"}}},"stop_1":{"type":"stop","logging_enabled":false,"x":32,"y":404,"inputs":{"stop":{"export_enabled":true}}},"pinterest_select_ad_account_ids_1":{"type":"pinterest_select_ad_account_ids","logging_enabled":false,"x":289,"y":124,"inputs":{"ad_account_ids":{"title":"ad_account_ids","description":"Select one or more Pinterest Ad Accounts"}}},"extract_1":{"type":"extract_v2","logging_enabled":false,"x":911,"y":216,"group":"group_1","inputs":{"pointer":{"export_enabled":true,"data":"/id"}}},"extract_list_1":{"type":"extract_list","logging_enabled":false,"x":675,"y":217,"group":"group_1","inputs":{"pointer":{"export_enabled":true,"data":"/id"}},"outputs":{"data_list":{"title":"campaign IDs","description":"The extracted data"}}},"replace_string_1":{"type":"replace_string","logging_enabled":false,"x":538,"y":199,"group":"group_2","inputs":{"regex":{"export_enabled":true,"data":"{ad_account_id}"},"pointer":{"export_enabled":true,"data":""},"schema":{"export_enabled":true,"data":"string"}}},"replace_string_2":{"type":"replace_string","logging_enabled":false,"x":1005,"y":197,"group":"group_2","inputs":{"regex":{"export_enabled":true,"data":"{CAMPAIGN_IDS}"},"pointer":{"export_enabled":true,"data":""},"schema":{"export_enabled":true,"data":"url"}}},"fetch_integration_url_v2_1":{"type":"fetch_integration_url_v2","logging_enabled":false,"x":1238,"y":196,"group":"group_2","inputs":{"headers":{"export_enabled":true},"field":{"export_enabled":true},"all_pages":{"export_enabled":true},"provider":{"export_enabled":true,"data":"pinterest"}},"outputs":{"fetched":{"title":"fetched","description":"Triggered when fetched"},"body":{"title":"body","description":"Body that got returned","export_enabled":true,"data":[{"SPEND_IN_DOLLAR":61.440988,"DATE":"2023-01-16","CAMPAIGN_ID":"626745444694","AD_ACCOUNT_ID":549755822149},{"SPEND_IN_DOLLAR":61.187951,"DATE":"2023-01-16","CAMPAIGN_ID":"626745444751","AD_ACCOUNT_ID":549755822149},{"SPEND_IN_DOLLAR":63.516256,"DATE":"2023-01-16","CAMPAIGN_ID":"626745535733","AD_ACCOUNT_ID":549755822149},{"SPEND_IN_DOLLAR":61.7187,"DATE":"2023-01-16","CAMPAIGN_ID":"626745542183","AD_ACCOUNT_ID":549755822149},{"SPEND_IN_DOLLAR":222.625273,"DATE":"2023-01-16","CAMPAIGN_ID":"626745933441","AD_ACCOUNT_ID":549755822149},{"SPEND_IN_DOLLAR":221.894536,"DATE":"2023-01-16","CAMPAIGN_ID":"626746152793","AD_ACCOUNT_ID":549755822149}]}}},"process_script_1":{"type":"process_script","title":"Convert Array Into String","description":"Processes a script and maps responses to the outputs","logging_enabled":false,"x":770,"y":197,"group":"group_2","inputs":{"b":{"export_enabled":true},"a":{"title":"a: campaign_ids","description":"Any data that is sent to the remote function"},"src":{"export_enabled":true,"data":"outputs['a'] = \",\".join(inputs['a'])"},"runtime":{"export_enabled":true,"data":"python3_7"}}},"replace_string_3":{"type":"replace_string","logging_enabled":false,"x":912,"y":268,"group":"group_3","inputs":{"regex":{"export_enabled":true,"data":"{date}"},"pointer":{"export_enabled":true,"data":""},"schema":{"export_enabled":true,"data":"any"},"data":{"export_enabled":true,"data":"https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/campaigns/analytics?start_date={date}\u0026end_date={date}\u0026granularity=DAY\u0026columns=SPEND_IN_DOLLAR,AD_ACCOUNT_ID\u0026campaign_ids={CAMPAIGN_IDS}\n"}}},"format_timestamp_v2_1":{"type":"format_timestamp_v2","logging_enabled":false,"x":645,"y":272,"group":"group_3","inputs":{"pattern":{"export_enabled":true,"data":"%Y-%m-%d"}}},"timestamp_1":{"type":"timestamp","logging_enabled":false,"x":378,"y":272,"group":"group_3"},"for_each_v2_1":{"type":"for_each_v2","logging_enabled":false,"x":289,"y":293},"filter_v2_1":{"type":"filter_v2","logging_enabled":false,"x":758,"y":295},"patch_json_list_v2_1":{"type":"patch_json_list_v2","logging_enabled":false,"x":1229,"y":291,"inputs":{"patches":{"export_enabled":true,"data":[{"op":"add","path":"/filter_value","value":"{{input.value/0/value}}"}]}}},"build_filter_1":{"type":"build_filter","logging_enabled":false,"x":757,"y":88,"inputs":{"filters":{"export_enabled":true,"data":[{"operator":"\u003e","pointer":"/SPEND_IN_DOLLAR","value":4000}]},"schema":{"export_enabled":true,"data":"tik_tok_report"}}},"start_1":{"type":"start","logging_enabled":false,"x":33,"y":353},"slack_select_conversation_id_1":{"type":"slack_select_conversation_id","logging_enabled":false,"x":1092,"y":33,"group":"group_4","inputs":{"conversation_id":{"title":"conversation_id","description":"Select a Slack Channel or Conversation"}}},"slack_notifier_v2_1":{"type":"slack_notifier_v2","logging_enabled":false,"x":409,"y":321,"group":"group_4","inputs":{"thread_ts":{"export_enabled":true}}},"slack_notifier_v2_2":{"type":"slack_notifier_v2","logging_enabled":false,"x":1119,"y":317,"group":"group_4"},"patch_json_v2_1":{"type":"patch_json_v2","logging_enabled":false,"x":883,"y":318,"group":"group_4","inputs":{"patches":{"export_enabled":true,"data":[{"op":"replace","path":"/0/text/text","value":"Your Pinterest Account has spent {{input.value/SPEND_IN_DOLLAR}}. You get this notification because spend exceeds {{input.value/filter_value}}.  "},{"op":"replace","path":"/1/elements/0/url","value":"https://ads.pinterest.com/advertiser/{{input.value/AD_ACCOUNT_ID}}"}]},"data":{"export_enabled":true,"data":[{"type":"section","text":{"type":"mrkdwn","text":""}},{"type":"actions","elements":[{"type":"button","text":{"type":"plain_text","text":"Open in Ads Manager"},"url":""}]}]}}},"for_each_v2_2":{"type":"for_each_v2","logging_enabled":false,"x":641,"y":320,"group":"group_4"},"delay_1":{"type":"delay","logging_enabled":false,"x":26,"y":122,"inputs":{"duration":{"export_enabled":true,"data":3600}}},"if_v2_1":{"type":"if_v2","logging_enabled":false,"x":995,"y":293,"inputs":{"b":{"export_enabled":true,"data":[]},"condition":{"export_enabled":true,"data":"not_equal"}}}},"edges":["slack_select_conversation_id_1.conversation_id:slack_notifier_v2_2.conversation_id","build_filter_1.filters:filter_v2_1.filters","patch_json_v2_1.data:slack_notifier_v2_2.blocks","patch_json_v2_1.patched:slack_notifier_v2_2.send","build_filter_1.filters:patch_json_list_v2_1.value","fetch_integration_url_v2_1.fetched:filter_v2_1.filter","replace_string_3.data:replace_string_1.data","timestamp_1.done:format_timestamp_v2_1.format","format_timestamp_v2_1.formatted:replace_string_3.replace","timestamp_1.timestamp:format_timestamp_v2_1.timestamp","format_timestamp_v2_1.date_time:replace_string_3.value","replace_string_2.replaced:fetch_integration_url_v2_1.fetch","process_script_1.a:replace_string_2.value","replace_string_1.replaced:process_script_1.process","extract_list_1.data_list:process_script_1.a","delay_1.delayed:for_each_v2_1.start","for_each_v2_1.done:delay_1.start","replace_string_3.replaced:replace_string_1.replace","pinterest_select_ad_account_ids_1.ad_account_ids:for_each_v2_1.items","extract_1.data:replace_string_1.value","replace_string_1.data:replace_string_2.data","replace_string_2.data:fetch_integration_url_v2_1.url","process_script_1.processed:replace_string_2.replace","start_1.start:for_each_v2_1.start","fetch_integration_url_v2_1.body:filter_v2_1.items","patch_json_list_v2_1.data_list:for_each_v2_2.items","for_each_v2_2.item:patch_json_v2_1.value","slack_select_conversation_id_1.conversation_id:slack_notifier_v2_1.conversation_id","slack_notifier_v2_1.thread_ts:slack_notifier_v2_2.thread_ts","slack_notifier_v2_1.sent:for_each_v2_2.start","patch_json_list_v2_1.patched:slack_notifier_v2_1.send","slack_notifier_v2_2.sent:for_each_v2_2.next","for_each_v2_2.do:patch_json_v2_1.patch","filter_v2_1.items:patch_json_list_v2_1.data_list","for_each_v2_2.done:for_each_v2_1.next","filter_v2_1.filtered:if_v2_1.evaluate","filter_v2_1.items:if_v2_1.a","if_v2_1.true:patch_json_list_v2_1.patch","if_v2_1.false:for_each_v2_1.next","data_relay_1.data:extract_1.data","pinterest_fetch_campaigns_1.fetched:extract_list_1.extract","data_relay_1.data:pinterest_fetch_campaigns_1.ad_account_id","for_each_v2_1.item:data_relay_1.data","extract_1.extracted:timestamp_1.now","extract_list_1.extracted:extract_1.extract","pinterest_fetch_campaigns_1.campaigns:extract_list_1.data_list","for_each_v2_1.do:pinterest_fetch_campaigns_1.fetch"],"groups":{"group_4":{"title":"Send Slack Message","description":"","x":1462,"y":295,"inputs":["slack_notifier_v2_1.send","for_each_v2_2.items"],"outputs":["for_each_v2_2.done"]},"group_1":{"title":"Get Account Spend","description":"","x":525,"y":299,"inputs":["pinterest_fetch_campaigns_1.fetch","data_relay_1.data"],"outputs":["fetch_integration_url_v2_1.fetched","fetch_integration_url_v2_1.body"]},"group_2":{"title":"Get campaign spend","description":"","x":1149,"y":220,"group":"group_1","inputs":["replace_string_1.value","process_script_1.a","timestamp_1.now"],"outputs":["fetch_integration_url_v2_1.body","fetch_integration_url_v2_1.fetched"]},"group_3":{"title":"Get today's date","description":"","x":302,"y":205,"group":"group_2","inputs":["timestamp_1.now"],"outputs":["replace_string_3.data","replace_string_3.replaced"]}},"widgets":{"widget_1":{"title":"Slack Channel","description":"Select a Slack Channel","position":1,"input":"slack_select_conversation_id_1.conversation_id"},"widget_2":{"title":"Ad Accounts","description":"Select one or more Pinterest Ad Accounts","position":0,"input":"pinterest_select_ad_account_ids_1.ad_account_ids"},"widget_3":{"title":"Run every","description":"The duration to delay the trigger (in Seconds)","position":0,"input":"delay_1.duration"},"widget_4":{"title":"Filters","description":"Filter Facebook insights based on your criteria","position":3,"icon":"las la-filter","input":"build_filter_1.filters"}},"variables":{},"config":{"capture_inputs_enabled":false,"caching_enabled":false},"tags":[]}
High Spend: Slack Notifier [Account level]
{"name":"[Slack alert] Pinterest High Spend - Account Level","description":"A blank recipe","nodes":{"stop_1":{"type":"stop","logging_enabled":false,"x":23,"y":396,"inputs":{"stop":{"export_enabled":true}}},"for_each_v2_1":{"type":"for_each_v2","logging_enabled":false,"x":275,"y":319},"patch_json_list_v2_1":{"type":"patch_json_list_v2","logging_enabled":false,"x":1214,"y":310,"inputs":{"patches":{"export_enabled":true,"data":[{"op":"add","path":"/filter_value","value":"{{input.value/0/value}}"}]}}},"delay_1":{"type":"delay","logging_enabled":false,"x":22,"y":119,"inputs":{"duration":{"export_enabled":true,"data":3600}}},"filter_v2_1":{"type":"filter_v2","logging_enabled":false,"x":744,"y":316,"outputs":{"filtered":{"title":"filtered","description":"Triggered when filtered"}}},"build_filter_1":{"type":"build_filter","logging_enabled":false,"x":734,"y":88,"inputs":{"filters":{"export_enabled":true,"data":[{"operator":"\u003e","pointer":"/SPEND_IN_DOLLAR","value":4000}]},"schema":{"export_enabled":true,"data":"tik_tok_report"}}},"pinterest_select_ad_account_ids_1":{"type":"pinterest_select_ad_account_ids","logging_enabled":false,"x":274,"y":119,"inputs":{"ad_account_ids":{"title":"ad_account_ids","description":"Select one or more Pinterest Ad Accounts"}}},"replace_string_1":{"type":"replace_string","logging_enabled":false,"x":838,"y":171,"group":"group_1","inputs":{"value":{"title":"ad_account_id","description":"Value that should replace the regex"},"regex":{"export_enabled":true,"data":"{ad_account_id}"},"pointer":{"export_enabled":true,"data":""},"schema":{"export_enabled":true,"data":"string"}}},"fetch_integration_url_v2_1":{"type":"fetch_integration_url_v2","logging_enabled":false,"x":1076,"y":170,"group":"group_1","inputs":{"headers":{"export_enabled":true},"field":{"export_enabled":true},"all_pages":{"export_enabled":true},"provider":{"export_enabled":true,"data":"pinterest"}},"outputs":{"fetched":{"title":"fetched","description":"Triggered when fetched"},"body":{"title":"body","description":"Body that got returned","export_enabled":true,"data":[{"SPEND_IN_DOLLAR":1016.513788,"DATE":"2023-02-16","AD_ACCOUNT_ID":"549755822149"}]}}},"replace_string_2":{"type":"replace_string","logging_enabled":false,"x":937,"y":256,"group":"group_2","inputs":{"regex":{"export_enabled":true,"data":"{date}"},"pointer":{"export_enabled":true,"data":""},"schema":{"export_enabled":true,"data":"any"},"data":{"export_enabled":true,"data":"https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/analytics?start_date={date}\u0026end_date={date}\u0026granularity=DAY\u0026columns=SPEND_IN_DOLLAR,AD_ACCOUNT_ID\n"}}},"format_timestamp_v2_1":{"type":"format_timestamp_v2","logging_enabled":false,"x":702,"y":257,"group":"group_2","inputs":{"pattern":{"export_enabled":true,"data":"%Y-%m-%d"}}},"timestamp_1":{"type":"timestamp","logging_enabled":false,"x":463,"y":257,"group":"group_2"},"extract_1":{"type":"extract_v2","logging_enabled":false,"x":601,"y":172,"group":"group_1","inputs":{"data":{"title":"ad_account","description":"The data from which to extract"},"pointer":{"export_enabled":true,"data":""}}},"slack_notifier_v2_1":{"type":"slack_notifier_v2","logging_enabled":false,"x":560,"y":338,"group":"group_3","inputs":{"thread_ts":{"export_enabled":true}}},"patch_json_v2_1":{"type":"patch_json_v2","logging_enabled":false,"x":245,"y":339,"group":"group_3","inputs":{"patches":{"export_enabled":true,"data":[{"op":"replace","path":"/0/text/text","value":"Your Pinterest Account has spent {{input.value/0/SPEND_IN_DOLLAR}}. You get this notification because spend exceeds {{input.value/0/filter_value}}.  "},{"op":"replace","path":"/1/elements/0/url","value":"https://ads.pinterest.com/advertiser/{{input.value/0/AD_ACCOUNT_ID}}"}]},"data":{"export_enabled":true,"data":[{"type":"section","text":{"type":"mrkdwn","text":""}},{"type":"actions","elements":[{"type":"button","text":{"type":"plain_text","text":"Open in Ads Manager"},"url":""}]}]}}},"slack_select_conversation_id_1":{"type":"slack_select_conversation_id","logging_enabled":false,"x":315,"y":84,"group":"group_3","inputs":{"conversation_id":{"title":"conversation_id","description":"Select a Slack Channel or Conversation"}}},"start_1":{"type":"start","logging_enabled":false,"x":24,"y":345},"if_v2_1":{"type":"if_v2","logging_enabled":false,"x":980,"y":313,"inputs":{"b":{"export_enabled":true,"data":[]},"condition":{"export_enabled":true,"data":"not_equal"}}}},"edges":["slack_select_conversation_id_1.conversation_id:slack_notifier_v2_1.conversation_id","build_filter_1.filters:filter_v2_1.filters","patch_json_v2_1.data:slack_notifier_v2_1.blocks","patch_json_v2_1.patched:slack_notifier_v2_1.send","filter_v2_1.items:patch_json_list_v2_1.data_list","patch_json_list_v2_1.patched:patch_json_v2_1.patch","patch_json_list_v2_1.data_list:patch_json_v2_1.value","build_filter_1.filters:patch_json_list_v2_1.value","start_1.start:for_each_v2_1.start","delay_1.delayed:for_each_v2_1.start","for_each_v2_1.done:delay_1.start","pinterest_select_ad_account_ids_1.ad_account_ids:for_each_v2_1.items","slack_notifier_v2_1.sent:for_each_v2_1.next","filter_v2_1.filtered:if_v2_1.evaluate","if_v2_1.true:patch_json_list_v2_1.patch","if_v2_1.false:for_each_v2_1.next","filter_v2_1.items:if_v2_1.a","for_each_v2_1.do:timestamp_1.now","extract_1.extracted:replace_string_1.replace","replace_string_2.replaced:extract_1.extract","for_each_v2_1.item:extract_1.data","fetch_integration_url_v2_1.fetched:filter_v2_1.filter","replace_string_2.data:replace_string_1.data","timestamp_1.done:format_timestamp_v2_1.format","format_timestamp_v2_1.formatted:replace_string_2.replace","timestamp_1.timestamp:format_timestamp_v2_1.timestamp","format_timestamp_v2_1.date_time:replace_string_2.value","replace_string_1.replaced:fetch_integration_url_v2_1.fetch","replace_string_1.data:fetch_integration_url_v2_1.url","extract_1.data:replace_string_1.value","fetch_integration_url_v2_1.body:filter_v2_1.items"],"groups":{"group_1":{"title":"Get Account Spend","description":"","x":510,"y":323,"inputs":["timestamp_1.now","extract_1.data"],"outputs":["fetch_integration_url_v2_1.body","fetch_integration_url_v2_1.fetched"]},"group_2":{"title":"Get today's date","description":"","x":368,"y":178,"group":"group_1","inputs":["timestamp_1.now"],"outputs":["replace_string_2.data","replace_string_2.replaced"]},"group_3":{"title":"Send Slack Message","description":"","x":1449,"y":313,"inputs":["patch_json_v2_1.value","patch_json_v2_1.patch"],"outputs":["slack_notifier_v2_1.sent"]}},"widgets":{"widget_1":{"title":"Filters","description":"Filter Facebook insights based on your criteria","position":3,"icon":"las la-filter","input":"build_filter_1.filters"},"widget_2":{"title":"Slack Cahnnel","description":"Select a Slack Channel","position":1,"input":"slack_select_conversation_id_1.conversation_id"},"widget_3":{"title":"Ad Accounts","description":"Select one or more Pinterest Ad Accounts","position":0,"input":"pinterest_select_ad_account_ids_1.ad_account_ids"},"widget_4":{"title":"Run every","description":"The duration to delay the trigger (in Seconds)","position":0,"input":"delay_1.duration"}},"variables":{},"config":{"capture_inputs_enabled":false,"caching_enabled":false},"tags":[]}

How To

Step 1

Select an Ad Account

Notion image

Step 2

Select a Slack Channel, in which you would like to receive the notifications

Notion image

Step 3

Define how often you want the automation to run

Notion image

Step 4

Select a threshold for the daily spend

Notion image
  1. In the Filter section, click Edit.
  1. In the Value, enter the highest possible daily spend on a campaign level. if the amount is higher, you will get a Slack Notification.
 
⚠️
By default, all active campaigns in an account will be checked (to use it at the account level, select the second recipe above).
 
Did this answer your question?
😞
😐
🤩

Last updated on January 16, 2023